<template>
	<!-- 服务 -->
	<view class="box" v-html="text">
		<!-- <rich-text nodes="{{richtext}}" onTap="tap"></rich-text> -->
		<!-- <rich-text :nodes="text"></rich-text> -->
	</view>
</template>

<script>
	import parse from 'mini-html-parser2'
	export default {
		data() {
			return {
				// richtext
				richtext: '<p>你好</p>',
				text: ''
			}
		},
		mounted() {

		},
		onLoad(e) {
			this.getRich(e.id)



		},
		methods: {
			getRich(id) {
				this.$http('other.richtext', {
					id
				}).then(res => {
					if (res.code == 1) {
						uni.setNavigationBarTitle({
							title: res.data.title
						})
						this.richtext = res.data.content

						// #ifdef MP-ALIPAY
						parse(this.richtext, (err, htmlData) => {
							if (!err) {
								this.text = htmlData
							}
						})

						//  #endif
						
						
					// #ifdef H5 || APP-PLUS
						this.text = res.data.content
					
					//  #endif
					}
				})
			}

		}
	}
</script>

<style lang="scss" scoped>
	.box {
		width: 100%;
		padding: 30rpx;
		background-color: #f4f6f4;
		min-height: 100vh;

	}
</style>
